package stark.app.function.tbs;

import android.content.Context;
import android.content.Intent;
import android.view.ViewGroup;

import com.stark.tbs.lib.BaseTbsReaderActivity;

import androidx.annotation.NonNull;
import stark.app.R;
import stark.app.databinding.ActivityTbsReaderBinding;
import stark.common.basic.constant.Extra;
import stark.common.basic.utils.IntentUtil;

/**
 * Author：daizhongbin on 2022/7/15
 * Email：1027154338@qq.com
 * Desc:
 */
public class TbsReaderActivity extends BaseTbsReaderActivity<ActivityTbsReaderBinding> {

    public static void start(Context context, String filePath) {
        Intent intent = IntentUtil.getIntent(context, TbsReaderActivity.class);
        intent.putExtra(Extra.PATH, filePath);
        context.startActivity(intent);
    }

    @NonNull
    @Override
    protected ViewGroup getTbsReaderViewContainer() {
        return mDataBinding.flContainer;
    }

    @NonNull
    @Override
    protected String getOpenFilePath() {
        Intent intent = getIntent();
        String path = intent.getStringExtra(Extra.PATH);
        return path;
    }

    @Override
    protected int onCreate() {
        return R.layout.activity_tbs_reader;
    }
}
